import Vue from 'vue'
import App from './App'

import uView from "uview-ui";
Vue.use(uView);
import BigNumber from 'bignumber.js'
Vue.prototype.$BigNumber = BigNumber


import wxLoginMadal from "@/components/wxLoginMadal/wxLoginMadal.vue"
Vue.component("wx-login-madal",wxLoginMadal)

// Vue.prototype.$timer = null

let vuexStore = require("@/store/$u.mixin.js");
Vue.mixin(vuexStore);
import store from '@/store';

Vue.config.productionTip = false

App.mpType = 'app'

const app = new Vue({
	store,
    ...App
})
// http拦截器，此为需要加入的内容，如果不是写在common目录，请自行修改引入路径
import httpInterceptor from '@/common/http.interceptor.js'
// 这里需要写在最后，是为了等Vue创建对象完成，引入"app"对象(也即页面的"this"实例)
Vue.use(httpInterceptor, app)

// 引入uView对小程序分享的mixin封装
let mpShare = require('uview-ui/libs/mixin/mpShare.js');
Vue.mixin(mpShare)

// http接口API集中管理引入部分
import httpApi from '@/common/http.api.js'
Vue.use(httpApi, app)

Vue.prototype.$getMemberInfo = (uid)=>{
	return new Promise ((resolve, reject) => {
		let params = {
			uuid : uid
		}
		app.$u.api.getMemberInfo(params).then(res=>{
			resolve(res)
		}).catch(err=>{
			reject(err)
		})
	})
}

app.$mount()
